Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trains #110

Merged
merged 10 commits into from
Jun 20, 2024
Merged

Trains #110

merged 10 commits into from
Jun 20, 2024

Conversation

Groneschild
Copy link
Contributor

@Groneschild Groneschild commented Jun 10, 2024

I Wasn't planning on making a pr, but here I am.

The first thing i did, was making a tool to make straight road connections. It looks better for both rail and highway infrastructure. I would like to enforce something like this for realistic looking rail.

The second thing are custom trains. The toolbox contains a train editor. Trains consist of rolling-stock. Anyone can add rolling-stock in base_mod/rollingstock.lua. I would like a similar thing for road vehicles.

Give me some help with the GUI related programming.

Groneschild and others added 7 commits January 22, 2024 20:21
Straight for road and rail:
Based on the start and end MapProject, a dot will appear that indicates a
straight connection from the selected MapProject.

Curved connection ProjectState:
When clicking on any MapProject and Ground or Intersection, a straight
road would be created. Now an interpolation point needs to be set.

Function for line line intersection
With four points, representing two lines, the intersection of these two
lines is calculated

Function for line closed point
Given two points representing one line and one point, the closed point
on the line from the third point is calculated.
Substitute functions Vec2::{line_line_intersection, line_closed_point}
with Line::{intersection_point, project}
Make costum trains of any length for any persose. Make commuter, freight
or high speed trains.
@CLAassistant
Copy link

CLAassistant commented Jun 10, 2024

CLA assistant check
All committers have signed the CLA.

@Uriopass
Copy link
Owner

Thank you for this (big!) contribution.
I'm away for a week or so but I'll make sure to review when I come back!

@Uriopass
Copy link
Owner

Uriopass commented Jun 20, 2024

Hey so I finally got to review. The code looks good but I have a bit of feedback about the UI.
I guess it can probably be improved later on as yakui can take a bit of time to learn.

  • Max Incline and Max Decline don't seem to be implemented yet, I think the icons should be disabled in the meantime.
  • The straight road thingy is really good! Could probably be improved like in cities skylines to offer alignment with other roads, but the idea is great!
  • The custom train editor is super cool but I think most players would want a set of pre-made trains. The UI is also quite raw, would need a lot more icons to be practical.
  • You don't use rustfmt, it does look more ergonomic at times but I really like having a consistent style. You can disable rustfmt on blocks using the #[rustfmt::skip] annotation when you really need to.

Anyway all of these aren't blockers, the game is still in development after all and all these can be fixed later on. Still a good foundation! I'm going to merge this.

@Uriopass Uriopass merged commit eae0275 into Uriopass:master Jun 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants